/**
 * 两个材料数组进行去重合并
 * @param {*} arr1 
 * @param {*} arr2 
 * @returns 
 */
export function compare(arr1, arr2) {
    arr1.forEach(element => {
        for(let i = 0; i < arr2.length;i++){
            if (element.materialId == arr2[i].materialId) {
                element.planQuantity = parseInt(arr2[i].planQuantity) + parseInt(element.planQuantity);
                arr2.splice(i--,1)
            }
        }
    });
    return [...arr1,...arr2]
}